//
//  RowTableViewCell.m
//  IT爱好者
//
//  Created by dllo on 15/10/16.
//  Copyright © 2015年 Fan. All rights reserved.
//

#import "RowTableViewCell.h"
#import "Header.h"
@implementation RowTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatViews];
    }
    return self;
}

- (void)creatViews
{
    _nameL = [[UILabel alloc]initWithFrame:CGRectMake(15 * FitWidth, 15 * FitHeight, 230 * FitWidth, 20 * FitHeight)];
    _nameL.font = [UIFont systemFontOfSize:13];
    
    [self.contentView addSubview:_nameL];
    
    _forum = [[UILabel alloc]initWithFrame:CGRectMake(_nameL.frame.origin.x + _nameL.frame.size.width, _nameL.frame.origin.y, 50 * FitWidth, _nameL.frame.size.height)];
    _forum.font = otherTextSize;
    _forum.textColor = [UIColor grayColor];
    [self.contentView addSubview:_forum];
    
    _totalNum = [[UILabel alloc]initWithFrame:CGRectMake(_forum.frame.origin.x + _forum.frame.size.width, _forum.frame.origin.y, 100 * FitWidth, _forum.frame.size.height)];
    _totalNum.font = otherTextSize;
    _totalNum.textColor = [UIColor grayColor];
    [self.contentView addSubview:_totalNum];
}

-(void)layoutSubviews
{
    [super layoutSubviews];
    _nameL.textColor = contenttextColor;
}
-(void)setRLModel:(RowListModel *)RLModel
{
    if (_RLModel != RLModel) {
        _RLModel = RLModel;
    }
    _nameL.text = RLModel.name;
    _forum.text = @"帖子";
//    if ([[RLModel.total objectForKey:@"num"] class] == [NSString class]) {
//        //NSLog(@"%@", [RLModel.total objectForKey:@"num"]);
//    }
    _totalNum.text = [NSString stringWithFormat:@"%@", [RLModel.total objectForKey:@"num"]];
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
